package net.zjitc.service.impl;

import net.zjitc.dao.SecondDao;
import net.zjitc.dao.impl.SecondDaoImpl;
import net.zjitc.domain.Category;
import net.zjitc.domain.CategorySecond;
import net.zjitc.service.SecondService;

import java.sql.SQLException;
import java.util.List;

/**
 * 2 * @Author: 洪瑶
 * 3 * @Date: 2018/10/30 8:17
 * 4
 */
public class SecondServiceImpl implements SecondService{
    SecondDao dao = new SecondDaoImpl();
    @Override
    public List<CategorySecond> findAll() throws SQLException {
        return dao.sqlfindAll();
    }

    @Override
    public boolean add(CategorySecond second) throws SQLException {
        return dao.sqladd(second);
    }

    @Override
    public void delete(int id) throws SQLException {
        dao.sqldelete(id);
    }

    @Override
    public CategorySecond findBy(int id) throws SQLException {
        return dao.sqlfindBy(id);
    }

    @Override
    public boolean Update(CategorySecond second, String id) throws SQLException {
        return dao.sqlUpdate(second,id);
    }
}
